Learn R Programming

Compositional (version 5.0)

Zero adjusted Dirichlet regression: Zero adjusted Dirichlet regression

Description

Zero adjusted Dirichlet regression.

Usage

zadr(y, x, xnew = NULL, tol = 1e-05)

mixreg(param, z)

Arguments

y

A matrix with the compositional data (dependent variable). The number of observations (vectors) with no zero values should be more than the columns of the predictor variables. Otherwise, the initial values will not be calculated.

x

The predictor variable(s), they can be either continnuous or categorical or both.

xnew

If you have new data use it, otherwise leave it NULL.

tol

A tolerance level to terminate the maximisation process.

param

Some arguments passed on to the mixreg helper function.

z

Some arguments passed on to the mixreg helper function.

Value

A list including:

runtime

The time required by the regression.

loglik

The value of the log-likelihood.

phi

The precision parameter. If covariates are linked with it (function "diri.reg2"), this will be a vector.

be

The beta coefficients.

seb

The standard error of the beta coefficients.

sigma

Th covariance matrix of the regression parameters (for the mean vector and the phi parameter) in the function "diri.reg2".

est

The fitted or the predicted values (if xnew is not NULL).

Details

A zero adjusted Dirichlet regression is being fittd. The likelihood conists of two components. The contributions of the non zero compositional values and the contributions of the compositional vectors with at least one zero value. The second component may have many different sub-categories, one for each pattern of zeros. The function "mixreg" is a helper function and is not intended to be called directly by the user.

References

Tsagris M. and Stewart C. (2018). A Dirichlet Regression Model for Compositional Data with Zeros. Accepted at the Lobachevskii Journal of Mathematics.

Preprint available from https://arxiv.org/pdf/1410.5011.pdf

See Also

diri.reg, kl.compreg, ols.compreg, alfa.reg

Examples

Run this code
# NOT RUN {
x <- as.vector(iris[, 4])
y <- as.matrix(iris[, 1:3])
y <- y / rowSums(y)
mod1 <- diri.reg(y, x)
y[sample(1:450, 15) ] <- 0
mod2 <- zadr(y, x)
# }

Run the code above in your browser using DataLab